<?php
extract(array(
	'object_type' => 'product',
	'width' => (isset($pair->image->image_x) ? $pair->image->image_x : 100),
	'height' => (isset($pair->image->image_y) ? $pair->image->image_y : 100),
	'no_link' => true,
	'return_url' => false,
	'class' => '',
), EXTR_SKIP);

if ( isset($pair->pair_id) && isset($pair->image_id) && isset($pair->image) ) {
//	$img = CHtml::image('/', '', array('id' => 'image_'.$object_type.'_'.$pair->pair_id, 'alt' => '', 'border' => 0));
	$img = img($object_type, $pair->image->image_path, '', array('id' => 'image_'.$object_type.'_'.$pair->pair_id, 'border' => 0, 'itemprop' => 'image', 'class' => $class . ' item-image-thumb'), array('width' => $width, 'height' => $height), $return_url, $object_type != "banner");
	if ( $no_link ) {
		echo $img;
	} else {
		echo CHtml::link($img, '/', array('target' => '_blank')) ;
	}
} else {
	echo img($object_type, 'no_image.png', '', array('id' => 'image_'.$object_type.'_'.rand(1000, 9999), 'border' => 0, 'itemprop' => 'image', 'class' => $class . ' item-image-thumb'), array('width' => $width, 'height' => $height), $return_url, $object_type != "banner");
	//echo CHtml::image(bu() . '/images/no_image.gif', '', array('alt' => '', 'border' => 0));
}
?>